<script>
  export default {
    name: "zTip",
    props:{
      text:{
        type: String,
        default: 'zTip'
      },
      content:{
        type: String,
        default: '距离结束还有${day}天'
      },
      day:{
        type: String,
        default: '0'
      },
      dayUrl:{
        type: String,
        default: '0' // JavaScript:void(0);
      },
      dayStyle:{
        type: Object,
        default: ()=>{}
      }
    },
    render(h) {
      const { content, day, dayUrl, dayStyle } = this; 
      let arr = content.split('${day}')
      console.log(arr, dayStyle)
      const zTip = h(
        'span',
	      {
	        class: 'z-tip',
	      },
        [ arr[0],
          h(
            'a',
            {
              style:dayStyle,
              domProps:{
                href: dayUrl           
              }
            },
            day
          ),
          arr[1]
        ]
      )
      return zTip;
    }
  }
</script>

<style scoped>
	.z-tip{
		color: #333;
    a{
      text-decoration: none;
    }
	}
</style>
